package com.mk.admin.controller;

import com.mk.admin.model.*;
import com.mk.admin.model.vo.*;
import com.mk.admin.service.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/a/adm/orderTemplate")
@Api(tags = "模版")
public class OrderTemplateController {
    @Autowired
    private  OrderTemplateService orderTemplateService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody TemplateVo vo) {
        return orderTemplateService.select(vo);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody TemplateVo vo) {
        return orderTemplateService.add(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody TemplateVo vo) {
        return orderTemplateService.delete(vo.getId());
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody TemplateVo vo) {
        System.out.println(vo);
        return orderTemplateService.update(vo);
    }
}
